<%@tag description="column tag" pageEncoding="UTF-8"%>
<%@ include file="/taglibs.jsp" %>

<%-- The list of normal or fragment attributes can be specified here: --%>
<%@attribute name="name"%>
<%@attribute name="title"%>
<%@attribute name="css_class"%>

<c:if test="${empty title}">
    <c:set var="title" value=""/>
</c:if>
<c:if test="${!empty name && empty title}">
    <c:set var="title" value="${name}"/>
</c:if>
<c:if test="${!_colsSet}">
    <%
        java.util.ArrayList cols = (java.util.ArrayList) jspContext.getAttribute("_colNames", PageContext.REQUEST_SCOPE);
        String title = (String) jspContext.getAttribute("title");
        if (title == null) {
            title = "";
        }

        cols.add(title);
    %>
</c:if>

<c:if test="${!empty css_class}">
    <c:set var="css_clause" value="class=\"${css_class}\""/>
</c:if>

<c:if test="${!empty name}">
    <td>${_colValue[name]}</td>
</c:if>
<c:if test="${empty name}">
    <td ${css_clause}><jsp:doBody/></td>
</c:if>
